import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    // 根路径直接会跳转项目首页
    path: '/',
    name: 'FramePage',
    redirect: { name: "MonitorModule" },
    component: () => import(/* webpackChunkName: "FramePage" */ '@/views/FramePage/FramePage.vue'),
    children: [
      {
        path: 'MonitorModule',
        name: 'MonitorModule',
        component: () => import(/* webpackChunkName: "MonitorModule" */ '@/views/FramePage/MonitorModule/MonitorModule.vue'),
      },
      {
        path: 'ForecastModule',
        name: 'ForecastModule',
        redirect: { name: 'ObsData' },
        component: () => import(/* webpackChunkName: "ForecastModule" */ '@/views/FramePage/ForecastModule/ForecastModule.vue'),
        children: [
          {
            path: "ObsData",
            name: "ObsData",
            component: () => import(/* webpackChunkName: "ObsData" */ '@/views/FramePage/ForecastModule/ContentPage/ObsData.vue'),
          },
          {
            path: "ForecastData",
            name: "ForecastData",
            component: () => import(/* webpackChunkName: "ForecastData" */ '@/views/FramePage/ForecastModule/ContentPage/ForecastData.vue'),
          },
          {
            path: "CompositeImage",
            name: "CompositeImage",
            component: () => import(/* webpackChunkName: "CompositeImage" */ '@/views/FramePage/ForecastModule/ContentPage/CompositeImage.vue'),
          }
        ]
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
